Learning Objectives

After completing this lesson, you’ll be able to:

Workspaces as a Trigger

Workspaces and other Internal and External Actions have both input and output ports. This means that although they are treated as an Action because they need something to kick them off, they can also act as a Trigger to downstream Actions.

Automations workspace as trigger diagram

Workspaces can send messages containing content from the data being processed and report the status of a translation, such as whether it ran successfully or ended in failure.

Workspace Action Output Ports

By default, workspace nodes have two outports representing the workspace status: one for Success and one for Failure. These ports allow you to build an action in response to one or both job statuses. Each output includes a set of Output Attributes with additional information about the workspace that was run that can be used by downstream Actions connected to either port.

The Automations Writer can be used to add additional custom output ports to a Workspace Action simply by adding the writer into the workspace to be run. This will allow for setting up Actions to be triggered based on what happens within the workspace. The Automations Writer also allows for passing custom messages from within the workspace to Actions connected to the output port.

Therefore, messages can be passed downstream via Success, Failure, or custom ports.

Note

We will discuss the Automations Writer in more detail later in the course.

Working with Output Attributes in Automations Workflows

Messages pass along the components of Automations workflows, from Triggers to Actions to External actions, in the form of JSON-formatted parameter-value pairs. These parameter-value pairs represent various properties that are derived from the components of the workflow and form the content of the message. Each attribute output by a component can be sent downstream to the next component, and ultimately output by the workflow to a receiving application.

You can work with the Output Attributes of workflow messages in the following ways:

Viewing Attributes, Disabling/Enabling Attributes, and Creating Custom Attributes

As you build an Automation, you can control the attributes that are sent to downstream components, and that are ultimately included in the final message output. In the Details pane of a Trigger, Action, or External Action, select the Output Attributes tab. Here, you can:

Using Output Keys

The primary benefit of disabling attributes or creating Custom Attributes is to prevent them from being overwritten, where desired. The values of JSON objects with the same attribute strings are overwritten as they pass through a workflow. For example, consider a workflow that contains two Run Workspace Actions in sequence. Both Actions pass a job.timeStarted attribute, but the value that attribute produces in the first action is overwritten by the second Action. If you want to preserve only the job.timeStarted value of the first workspace, you can disable the job.timeStarted attribute in the configuration of the second Action, and preserve it in the first.

But what if you wanted to preserve both job.timeStarted values? In this case, you can create a custom attribute in both workspaces, give them each unique names, and base their values on job.timeStarted. Optionally, you can also disable job.timeStarted in both workspaces.

You can use Custom Attributes anywhere in a workflow that allows you to specify an attribute for a parameter value.

Creating Automation Parameters

You can create your own parameter-value pairs, prefixed with the global. tag. Automation Parameters allow you to reference a value in multiple components of a workflow without having to explicitly define it each time. You can use Automation Parameters anywhere in a workflow that allows you to specify an output attribute for a parameter value.

You can create Automation Parameters in two ways.

On the Automations toolbar, click the Automation Parameters Editor button:

Global Keys Editor button

Dynamically, when specifying a parameter value in a workflow. From an applicable parameter drop-down list, select Add to Automation Parameters.

Adding to Global Keys

In the Automation Parameters Editor, click + to start a new Global Attribute, enter a name (global.<your_name>), specify a Value, and click OK.

Global Keys Editor dialog

Filtering on an Output Attribute

You can use the Filter Messages Action to test for the presence of a string in an output attribute, and route messages in your workflow accordingly. For example, if the email.subject attribute from an Email Received (SMTP) trigger contains a specific string, you might choose to route the message differently from other emails that do not contain that string.

Note

Learn more about using Output Attributes.